import pymysql
try:
    coon = pymysql.connect(host='192.168.118.134',port=3306,user='root',
                           password='123456',database="test_b",charset="utf8")
    my_cursor = coon.cursor()
    my_cursor.execute("select version( );")
    res = my_cursor.fetchone()
    print(res)
    my_cursor.close()
    coon.close()
except Exception as e:
    print(f'{e}')
